﻿import ButtonIcon from "../../ui/ButtonIcon.jsx";
import {
    HiArrowRightOnRectangle
} from "react-icons/hi2";
import {useLogout} from "./useLogout.js";
import Spinner from "../../ui/Spinner.jsx";

function Logout(){
    const {logout,isLoading} = useLogout();

    return(
        <ButtonIcon disabled={isLoading} onClick={logout}>
            {
                !isLoading ? <HiArrowRightOnRectangle/> : <Spinner />
            }
        </ButtonIcon>
    );
}

export default Logout;